package com.party.mobile.biz.order.payOrder;

import com.party.core.model.mall.MallOrderOutputPay;
import com.party.core.model.order.OrderForm;
import com.party.core.service.mall.IMallOrderDetailService;
import com.party.mobile.biz.mall.MallOrderBizService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @ClassName CrowdfundPayOrderService
 * @Description 商城订单回调处理
 * @Author wei.li
 * @Date 2019/4/17
 **/
@Service
@Component("mallPayOrderService")
public class MallPayOrderService extends IPayOrderService {
    @Autowired
    private MallOrderBizService mallOrderBizService;
    @Autowired
    private IMallOrderDetailService mallOrderDetailService;

    @Override
    public Object doMain(OrderForm orderForm) {
        mallOrderBizService.payMall(orderForm.getId());
        return null;
    }

    @Override
    public void doAssist(OrderForm orderForm, Object resultObject) {
        MallOrderOutputPay orderOutputPay = mallOrderDetailService.findByOrderId(orderForm.getId());
        mallOrderBizService.payMallThread(orderOutputPay);
    }
}
